package com.leyou.mall.controller;


import com.leyou.common.pojo.R;
import com.leyou.mall.data.dto.MallSortDto;
import com.leyou.mall.mapper.MallSortMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xhh
 * @since 2022-07-12
 */
@RestController
@RequestMapping("/leyou.mall/mall-sort")
public class MallSortController {
    @Autowired
    private MallSortMapper mallSortMapper;
    /**
    * todo 获取分类信息
    * @param 
    * @return com.leyou.common.pojo.R
    * @author xhh
    * @data 2022/7/12 21:23
    * @deprecated 
    */
    @RequestMapping(value = "/getSort",method = RequestMethod.POST)
    public R getSort(){
        List<MallSortDto> sort = mallSortMapper.getSort();
        for (MallSortDto mallSortDto : sort) {
            System.out.println(mallSortDto.getName()+","+mallSortDto.getId()+","+mallSortDto);
        }
        HashSet set=new HashSet();
        List list=new ArrayList();
        list.addAll(set);
        return R.ok().data("list",sort);
    }
}

